package com.rp.system.test.controller;


import com.rp.common.aspect.annotetion.AutoLog;
import com.rp.common.result.ResultDTO;
import com.rp.system.test.service.SysTestService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 测试表 前端控制器
 * </p>
 *
 * @author vicente
 * @since 2021-01-18
 */
@Api(tags = "测试接口")
@RestController
@RequestMapping("/sys-test")
public class SysTestController {

    @Autowired
    private SysTestService sysTestService;


    @AutoLog(value = "测试接口-数据库查询测试")
    @ApiOperation(value = "数据库查询测试")
    @GetMapping("/list")
    public ResultDTO list() {
        return ResultDTO.success().data(sysTestService.list());
    }

    /**
     * 测试推送消息
     */
    @ResponseBody
    @GetMapping(value = "/push")
    public Object push(String topic,String msg) {
        //MqttConsumer.publish(topic, msg);
        return "测试成功";
    }

}
